<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>用户信息修改</title>

<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/update-user.css">

</head>
<body>
	<div class="add-user-form">

		<form id="add-user-form" action="SaveUser" method="post"
			enctype="application/x-www-form-urlencoded">

			<ul>

				<li>

					<p class="title-1">用户信息修改</p> <input type="hidden" name="id"
					value="${user.id}">
				</li>
				<li><span class="title-2">姓名:</span> <input class="input-1"
					type="text" name="name" value="${user.name}" size="30"> <span
					class="bottom-msg" id=""></span></li>
				<li><span class="title-2">用户名:</span> <input class="input-1"
					readonly="readonly" type="text" name="userName" id="user-name"
					value="${user.userName}" size="30"> <span
					class="bottom-msg" id="ck-user-name"
					${!empty userNameErr ? "style=\"display:block; color:#f00;\"":"" }>${userNameErr}</span></li>

				<li><span class="title-2">生日:</span> <select name="year"
					class="select-1">

						<c:forEach begin="1980" end="2018" step="1" var="cYear">



							<option ${cYear==year?"selected=\"selected\"":"" }
								value="${cYear}">${cYear}</option>
						</c:forEach>

				</select> <select name="month" class="select-2">

						<c:forEach begin="1" end="12" step="1" var="cMonth">
							<option ${cMonth==month?"selected=\"selected\"":"" }
								value="${cMonth}">${cMonth}</option>
						</c:forEach>

				</select> <select name="day" class="select-3">

						<c:forEach begin="1" end="31" step="1" var="cDay">
							<option ${cDay==day?"selected=\"selected\"":"" } value="${cDay}">${cDay}</option>
						</c:forEach>

				</select></li>

				<li><span class="title-2">部门:</span> <select name="branch"
					class="select-4">

						<!-- 人事部=1、财务部=2、研发部=3、市场部=4、销售部=5 -->

						<option ${user.branch==1?"selected=\"selected\"":""} value="1">人事部</option>
						<option ${user.branch==2?"selected=\"selected\"":""} value="2">财务部</option>
						<option ${user.branch==3?"selected=\"selected\"":""} value="3">研发部</option>
						<option ${user.branch==4?"selected=\"selected\"":""} value="4">市场部</option>
						<option ${user.branch==5?"selected=\"selected\"":""} value="5">销售部</option>

				</select></li>

				<li><span class="title-2">性别:</span> <label class="label-1">
						<input class="radio" type="radio" value="1" name="sex"
						${user.sex==1||user.sex!=0?"checked=\"checked\"":""}>男
				</label> <label class="label-2"> <input class="radio" type="radio"
						value="0" name="sex" ${user.sex==0?"checked=\"checked\"":""}>女
				</label></li>

				<li><span class="title-2">用户类型:</span> <label class="label-1">
						<input class="radio" type="radio" value="1" name="type"
						${user.type==1||user.type!=2?"checked=\"checked\"":""}>员工
				</label> <label class="label-2"> <input class="radio" type="radio"
						value="2" name="type" ${user.type==2?"checked=\"checked\"":""}>管理员
				</label></li>


				<li><span class="title-2">录入时间:</span> <input class="input-1"
					readonly="readonly" type="text" name="name"
					value='<fmt:formatDate value="${user.addDate}" pattern="yyyy-MM-dd HH:mm:ss"/>'
					size="30"> <span class="bottom-msg" id=""></span></li>




				<li><span class="title-2">修改时间:</span> <input class="input-1"
					readonly="readonly" type="text" name="name"
					value='<fmt:formatDate value="${user.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>'
					size="30"> <span class="bottom-msg" id=""></span></li>



				<li><input class="reset" type="reset" value="重置"> <input
					class="submit" type="submit" value="保存"></li>

			</ul>
		</form>

	</div>

	<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="js/add-user.js"></script>

</body>
</html>